CXXFLAG = -O2
INCPATH=-I../libutil/include
LIBRARY=../libutil/libutil.a -lpthread

HEADERS= Constants.h \
	DestSpecDVDestination.h \
	dvdest.h \
	dvpacketqueue.h \
	dvsource.h \
	FileDVSource.h \
	NetworkDVSource.h \
	rtp.h \
	SelfReflectDVDestination.h \
	MeasureDVDestination.h \
	dvlog.h \
	osyncstream.h 
		
SOURCES = DestSpecDVDestination.cpp \
	dvdest.cpp \
	dvmcast.cpp \
	dvpacketqueue.cpp \
	dvsource.cpp \
	FileDVSource.cpp \
	NetworkDVSource.cpp \
	SelfReflectDVDestination.cpp 

OBJS = DestSpecDVDestination.o \
	dvdest.o \
	dvmcast.o \
	dvpacketqueue.o \
	dvsource.o \
	FileDVSource.o \
	NetworkDVSource.o \
	SelfReflectDVDestination.o

../bin/dvmcast: Makefile $(OBJS) ../libutil/libutil.a
	g++ $(OBJS) $(LIBRARY) -o ../bin/dvmcast

../libutil/libutil.a:
	make -C ../libutil

DestSpecDVDestination.o: DestSpecDVDestination.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) DestSpecDVDestination.cpp
dvdest.o: dvdest.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) dvdest.cpp
dvmcast.o: dvmcast.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) dvmcast.cpp
dvpacketqueue.o: dvpacketqueue.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) dvpacketqueue.cpp
dvsource.o: dvsource.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) dvsource.cpp
FileDVSource.o: FileDVSource.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) FileDVSource.cpp
NetworkDVSource.o: NetworkDVSource.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) NetworkDVSource.cpp
SelfReflectDVDestination.o: SelfReflectDVDestination.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCPATH) SelfReflectDVDestination.cpp

clean:
	rm -f $(OBJS) ../bin/dvmcast
	make -C ../libutil clean
